Skip to content

Migrate IterableToContainInAnyOrderOnlyEntriesExpectationsSpec to kotlin-test - #2188

Merged
robstoll merged 4 commits into
robstoll:mainfrom
ShahriyarSheikh:migrate/iterable-to-contain-in-any-order-only-entries
Aug 25, 2026
Merged

Migrate IterableToContainInAnyOrderOnlyEntriesExpectationsSpec to kotlin-test#2188
robstoll merged 4 commits into
robstoll:mainfrom
ShahriyarSheikh:migrate/iterable-to-contain-in-any-order-only-entries

Conversation

@ShahriyarSheikh

Copy link
Copy Markdown

Closes #2024

Summary

  • migrate IterableToContainInAnyOrderOnlyEntriesExpectationsSpec from Spek to kotlin-test
  • migrate the shared spec to ExpectationFunctionBaseTest and test factories
  • update Fluent and Infix implementations to use the migrated abstract test
  • rewrite ambiguityTest with real subjects and valid expectations

Testing

  • :atrium-specs:compileKotlinJvm
  • :atrium-api-fluent:jvmTest --tests "ch.tutteli.atrium.api.fluent.en_GB.IterableToContainInAnyOrderOnlyEntriesExpectationsTest"
  • :atrium-api-infix:jvmTest --tests "ch.tutteli.atrium.api.infix.en_GB.IterableToContainInAnyOrderOnlyEntriesExpectationsTest"

I confirm that I have read the Contributor Agreements v1.0, agree to be bound on them and confirm that my contribution is compliant.


context("mismatches and additional entries") {
describe("mismatches and additional entries") {
it("1.1, $toBeGreaterThanFun(3.1), $toBeGreaterThanFun(4.1) -- $toBeGreaterThanFun(4.1) is wrong and 2.1, 3.1 and 4.1 are missing") {

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ShahriyarSheikh looks like this results in a file name which is too long for Microsoft (https://github.com/robstoll/atrium/actions/runs/32659214848/job/97251684965?pr=2188#step:5:454). I suggest we split
non_nullable_cases into multiple functions:

  • empty_collection
  • happy_cases
  • error_case_additional_entries
  • error_case_mismatches
  • error_case_mismatches_and_additional_entries
  • error_case_too_many_matchers
  • report_options

similar for nullableCases, lets split it into:

  • nullable_happy_cases
  • error_case_additional_entries (with it("null, $toEqualFun(1.1), $toEqualFun(3.1) -- second null was missing") {)
  • etc.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@robstoll good catch. I will split the non-nullable and nullable cases into separate test factories as suggested to shorten the generated test names. I’ll push the update shortly.

@codecov

codecov Bot commented Aug 24, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.28%. Comparing base (7087756) to head (df92458).

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #2188      +/-   ##
============================================
+ Coverage     90.90%   91.28%   +0.37%     
  Complexity      125      125              
============================================
  Files           469      469              
  Lines          4784     4784              
  Branches        242      242              
============================================
+ Hits           4349     4367      +18     
+ Misses          383      366      -17     
+ Partials         52       51       -1     
Flag Coverage Δ
current 90.90% <ø> (ø)
current_windows 90.00% <ø> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@robstoll robstoll left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ShahriyarSheikh now everything is green. Thanks for your first contribution to Atrium 🙂👍

How about another one?

@robstoll
robstoll merged commit ee67bc9 into robstoll:main Aug 25, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

migrate IterableToContainInAnyOrderOnlyEntriesExpectationsSpec to kotlin-test

2 participants